package com.firebird.oms.domain.sm;

// Generated 2009-11-20 18:24:23 by Hibernate Tools 3.2.5.Beta

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * TismLoginLog generated by hbm2java
 */
@Entity
@Table(name = "tism_login_log")
public class TismLoginLog implements java.io.Serializable {

	private static final long serialVersionUID = 1629525689144128468L;
	private Integer id;
	private Integer logType;
	private String sessionId;
	private Integer loginId;
	private String ipAddr;
	private String macAddr;
	private Date logTime;
	private String errDesc;
	private Integer state;

	public TismLoginLog() {
	}

	public TismLoginLog(Integer logType, String sessionId, Integer loginId,
			String ipAddr, String macAddr, Date logTime, String errDesc,
			Integer state) {
		this.logType = logType;
		this.sessionId = sessionId;
		this.loginId = loginId;
		this.ipAddr = ipAddr;
		this.macAddr = macAddr;
		this.logTime = logTime;
		this.errDesc = errDesc;
		this.state = state;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "log_type")
	public Integer getLogType() {
		return this.logType;
	}

	public void setLogType(Integer logType) {
		this.logType = logType;
	}

	@Column(name = "session_id", length = 36)
	public String getSessionId() {
		return this.sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	@Column(name = "login_id")
	public Integer getLoginId() {
		return this.loginId;
	}

	public void setLoginId(Integer loginId) {
		this.loginId = loginId;
	}

	@Column(name = "ip_addr", length = 20)
	public String getIpAddr() {
		return this.ipAddr;
	}

	public void setIpAddr(String ipAddr) {
		this.ipAddr = ipAddr;
	}

	@Column(name = "mac_addr", length = 20)
	public String getMacAddr() {
		return this.macAddr;
	}

	public void setMacAddr(String macAddr) {
		this.macAddr = macAddr;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "log_time", length = 0)
	public Date getLogTime() {
		return this.logTime;
	}

	public void setLogTime(Date logTime) {
		this.logTime = logTime;
	}

	@Column(name = "err_desc", length = 254)
	public String getErrDesc() {
		return this.errDesc;
	}

	public void setErrDesc(String errDesc) {
		this.errDesc = errDesc;
	}

	@Column(name = "state")
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public boolean equals(final Object other) {
		if (!(other instanceof TismLoginLog))
			return false;
		TismLoginLog castOther = (TismLoginLog) other;
		return new EqualsBuilder().append(id, castOther.id).append(logType,
				castOther.logType).append(sessionId, castOther.sessionId)
				.append(loginId, castOther.loginId).append(ipAddr,
						castOther.ipAddr).append(macAddr, castOther.macAddr)
				.append(logTime, castOther.logTime).append(errDesc,
						castOther.errDesc).append(state, castOther.state)
				.isEquals();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(id).append(logType).append(
				sessionId).append(loginId).append(ipAddr).append(macAddr)
				.append(logTime).append(errDesc).append(state).toHashCode();
	}

	public String toString() {
		return new ToStringBuilder(this).append("id", id).append("logType",
				logType).append("sessionId", sessionId).append("loginId",
				loginId).append("ipAddr", ipAddr).append("macAddr", macAddr)
				.append("logTime", logTime).append("errDesc", errDesc).append(
						"state", state).toString();
	}

}
